home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Macintosh Tracker 1.20 / source / Tracker Client Folder / Core 18⁄March⁄1994 / StandardFile.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-19  |  898 b   |  40 lines  |  [TEXT/KAHL]

  1. /* StandardFile.c */
  2.  
  3. #include "StandardFile.h"
  4. #include "CWindow.h"
  5. #include "File.h"
  6. #include "Compatibility.h"
  7.  
  8.  
  9. MyBoolean    FGetFile(FSSpec* FileInfo, pascal Boolean (*FileFilter)(CInfoPBRec* pb),
  10.                         OSType TypeList[4], short NumTypes)
  11.     {
  12.         StandardFileReply        MySFR;
  13.  
  14.         if (ActiveWindow != NIL)
  15.             {
  16.                 ActiveWindow->DoSuspend();
  17.                 ActiveWindow = NIL;
  18.             }
  19.         StandardGetFile((void*)FileFilter,NumTypes,TypeList,&MySFR);
  20.         *FileInfo = MySFR.sfFile;
  21.         return MySFR.sfGood;
  22.     }
  23.  
  24.  
  25. /* if you want to select folders, this routine isn't going to help. */
  26. MyBoolean    FPutFile(PString DefaultFileName, FSSpec* FileInfo, MyBoolean* Replacing)
  27.     {
  28.         StandardFileReply        MySFR;
  29.  
  30.         if (ActiveWindow != NIL)
  31.             {
  32.                 ActiveWindow->DoSuspend();
  33.                 ActiveWindow = NIL;
  34.             }
  35.         StandardPutFile(NIL,DefaultFileName,&MySFR);
  36.         *FileInfo = MySFR.sfFile;
  37.         *Replacing = MySFR.sfReplacing;
  38.         return MySFR.sfGood;
  39.     }
  40.